package com.wgts.wgts.mvp.presenter.imp;

import com.wgts.wgts.mvp.model.IEditStoreActivityModel;
import com.wgts.wgts.mvp.presenter.IEditStoreActivityPresenter;
import com.wgts.wgts.mvp.view.IEditStoreActivityView;
import com.wgts.wgts.netmodle.HttpResultSubscriber;
import com.wgts.wgts.netmodle.resp.EditStoreEntity;

/*
 *
 *
 *   data:2018/10/1121:19
 *
 */public class EditStoreActivityPresenter implements IEditStoreActivityPresenter {
     private IEditStoreActivityView view;
     private IEditStoreActivityModel model;

    public EditStoreActivityPresenter(IEditStoreActivityView view, IEditStoreActivityModel model) {
        this.view = view;
        this.model = model;
    }

    @Override
    public void editStore(String shopName, String shopImage, String shopDesc) {
        model.editStore(shopName, shopImage, shopDesc, new HttpResultSubscriber<EditStoreEntity>() {
            @Override
            public void onSuccess(EditStoreEntity editStoreEntity) {
                view.editStore(editStoreEntity);
            }

            @Override
            public void _onError(int status, String msg) {
                view.onError(status, msg);
            }
        });
    }
}
